import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'Home',
        component: () => import(/* webpackChunkName: "about" */ '../views/Home')
    },
    {
        path: '/lessonIntroduce',
        name: 'lessonIntroduce',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/lesson/lessonIntroduce.vue')

  },
  {
    path: '/loading',
    name: 'loading',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/loading/loading.vue')
  },
  {
    path: '/fraction',
    name: 'fraction',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/fraction/fraction.vue')

    },
    {
        path: '/fraction',
        name: 'fraction',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/fraction/fraction.vue')

    },
    {
        path: '/me',
        name: 'me',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/me/me.vue'),
        children: [
            //阅读广度 试题
            {
                path: 'meStatistics',
                name: 'meStatistics',
                component: () => import ('../views/me/meStatistics.vue')
            },
            //阅读广度 答题
            {
                path: 'merecord',
                name: 'merecord',
                component: () => import ('../views/me/merecord.vue')
            },
            //视觉记忆 试题
            {
                path: 'mesetting',
                name: 'mesetting',
                component: () => import ('../views/me/mesetting.vue')
            }
        ]
    },
    {
        path: '/collection',
        name: 'Collection',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/collection/index.vue'),
        meta:{
            title: '我的收藏'
        }

    },
    {
        path: '/lessonDetail',
        name: 'lessonDetail',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/lesson/lessonDetail.vue'),
    },
    {
        path: '/lessonTest',
        name: 'lessonTest',
        component: () => import(/* webpackChunkName: "about" */ '../views/lesson/lessonTest.vue'),
    },
	//阅读广度
    {
        path: '/lessTopic',
        name: 'lessTopic',
        component: () => import(/* webpackChunkName: "about" */ '../views/lesson/lessTopic.vue'),

    },
	{
	    path: '/lessonShow',
	    name: 'lessonShow',
	    component: () => import(/* webpackChunkName: "about" */ '../views/generalization/lessonShow.vue'),
	},
	{
	    path: '/lessonAnswer',
	    name: 'lessonAnswer',
	    component: () => import(/* webpackChunkName: "about" */ '../views/generalization/lessonAnswer.vue'),
	},
    {
        path: '/answerList',
        name:'answerList',
        component: () => import(/* webpackChunkName: "about" */ '../views/lesson/answerList.vue'),
    },
    // 登录
    {
        path: '/login',
        name: 'login',
        component: () => import(/* webpackChunkName: "about" */ '../views/login/login.vue'),
        meta:{
            title: '登录'
        }
    },
	// 分数
	{
	    path: '/score',
	    name: 'score',
	    component: () => import(/* webpackChunkName: "about" */ '../views/score/score.vue'),
	    meta:{
	        title: '分数'
	    }
	},
    {
        path: '/register',
        name: 'register',
        component: () => import(/* webpackChunkName: "about" */ '../views/login/register.vue'),
        meta:{
            title: '注册'
        }
    },
    {
        path: '/forgetPass',
        name: 'forgetPass',
        component: () => import(/* webpackChunkName: "about" */ '../views/login/forgetPass.vue'),
        meta:{
            title: '找回密码'
        }
    },
    {
        path: '/pretest',
        name: 'Pretest',
        component: () => import(/* webpackChunkName: "about" */ '../views/pretest/index.vue'),
        meta:{
            title: '学能前测'
        },
        children:[
            {
                path: '/child/readspan',
                name: 'Readspan',
                component: () => import(/* webpackChunkName: "about" */ '../views/pretest/child/readspan.vue'),
                meta:{
                    title: '阅读广度'
                }
            },
            {
                path: '/child/wordlogic',
                name: 'Wordlogic',
                component: () => import(/* webpackChunkName: "about" */ '../views/pretest/child/wordlogic.vue'),
                meta:{
                    title: '词语逻辑'
                }
            },
            {
                path: '/child/visualmemory',
                name: 'Visualmemory',
                component: () => import(/* webpackChunkName: "about" */ '../views/pretest/child/visualmemory.vue'),
                meta:{
                    title: '视觉记忆'
                }
            },
            {
                path: '/child/quantityliteracy',
                name: 'Quantityliteracy',
                component: () => import(/* webpackChunkName: "about" */ '../views/pretest/child/quantityliteracy.vue'),
                meta:{
                    title: '识字量'
                }
            },
            {
                path: '/child/longsentence',
                name: 'Longsentence',
                component: () => import(/* webpackChunkName: "about" */ '../views/pretest/child/longsentence.vue'),
                meta:{
                    title: '长句理解'
                }
            },
            {
                path: '/child/readactual',
                name: 'Readactual',
                component: () => import(/* webpackChunkName: "about" */ '../views/pretest/child/readactual.vue'),
                meta:{
                    title: '阅读实战'
                }
            },
            {
                path: '/child/visionspan',
                name: 'Visionspan',
                component: () => import(/* webpackChunkName: "about" */ '../views/pretest/child/visionspan.vue'),
                meta:{
                    title: '视觉广度'
                }
            }, 

        ]
    },
    {
        path: '/levelReview',
        name: 'levelReview',
        component: () => import(/* webpackChunkName: "about" */ '../views/pretest/levelReview.vue'),
        meta:{
            title: '学能前测-成绩'
        }
    },
    {
        path: '/personal',
        name: 'Personal',
        component: () => import(/* webpackChunkName: "about" */ '../views/personalcenter/index.vue'),
        meta:{
            title: '个人中心'
        }
    },
    {
        path: '/personal/record',
        name: 'Record',
        component: () => import(/* webpackChunkName: "about" */ '../views/personalcenter/record.vue'),
        meta:{
            title: '训练记录'
        }
    },
    {
        path: '/personal/setpage',
        name: 'Setpage',
        component: () => import(/* webpackChunkName: "about" */ '../views/personalcenter/setpage.vue'),
        meta:{
            title: '设置'
        }
    },
    {
        path: '/collectionlist',
        name: 'Collectionlist',
        component: () => import(/* webpackChunkName: "about" */ '../views/collection/collectionList.vue'),
        meta:{
            title: '收藏夹列表'
        }
    },
	{
	    path: '/testResult',
	    name: 'testResult',
	    component: () => import(/* webpackChunkName: "about" */ '../views/pretest/testResult.vue'),
	    meta:{
	        title: '前测结果'
	    }
	},
    {
        path: '/punchClock',
        name: 'PunchClock',
        component: () => import(/* webpackChunkName: "about" */ '../views/collection/punchClock.vue'),
        meta:{
            title: '打卡'
        }
    } 
     
]

const router = new VueRouter({
    routes
})

export default router
